# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OnDemandScanning.V1.Model.VulnerabilityOccurrence do
  @moduledoc """
  An occurrence of a severity vulnerability on a resource.

  ## Attributes

  *   `cvssScore` (*type:* `number()`, *default:* `nil`) - Output only. The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 where 0 indicates low severity and 10 indicates high severity.
  *   `cvssV2` (*type:* `GoogleApi.OnDemandScanning.V1.Model.CVSS.t`, *default:* `nil`) - The cvss v2 score for the vulnerability.
  *   `cvssVersion` (*type:* `String.t`, *default:* `nil`) - Output only. CVSS version used to populate cvss_score and severity.
  *   `cvssv3` (*type:* `GoogleApi.OnDemandScanning.V1.Model.CVSS.t`, *default:* `nil`) - The cvss v3 score for the vulnerability.
  *   `effectiveSeverity` (*type:* `String.t`, *default:* `nil`) - The distro assigned severity for this vulnerability when it is available, otherwise this is the note provider assigned severity. When there are multiple PackageIssues for this vulnerability, they can have different effective severities because some might be provided by the distro while others are provided by the language ecosystem for a language pack. For this reason, it is advised to use the effective severity on the PackageIssue level. In the case where multiple PackageIssues have differing effective severities, this field should be the highest severity for any of the PackageIssues.
  *   `extraDetails` (*type:* `String.t`, *default:* `nil`) - Occurrence-specific extra details about the vulnerability.
  *   `fixAvailable` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether at least one of the affected packages has a fix available.
  *   `longDescription` (*type:* `String.t`, *default:* `nil`) - Output only. A detailed description of this vulnerability.
  *   `packageIssue` (*type:* `list(GoogleApi.OnDemandScanning.V1.Model.PackageIssue.t)`, *default:* `nil`) - Required. The set of affected locations and their fixes (if available) within the associated resource.
  *   `relatedUrls` (*type:* `list(GoogleApi.OnDemandScanning.V1.Model.RelatedUrl.t)`, *default:* `nil`) - Output only. URLs related to this vulnerability.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - Output only. The note provider assigned severity of this vulnerability.
  *   `shortDescription` (*type:* `String.t`, *default:* `nil`) - Output only. A one sentence description of this vulnerability.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
  *   `vexAssessment` (*type:* `GoogleApi.OnDemandScanning.V1.Model.VexAssessment.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cvssScore => number() | nil,
          :cvssV2 => GoogleApi.OnDemandScanning.V1.Model.CVSS.t() | nil,
          :cvssVersion => String.t() | nil,
          :cvssv3 => GoogleApi.OnDemandScanning.V1.Model.CVSS.t() | nil,
          :effectiveSeverity => String.t() | nil,
          :extraDetails => String.t() | nil,
          :fixAvailable => boolean() | nil,
          :longDescription => String.t() | nil,
          :packageIssue => list(GoogleApi.OnDemandScanning.V1.Model.PackageIssue.t()) | nil,
          :relatedUrls => list(GoogleApi.OnDemandScanning.V1.Model.RelatedUrl.t()) | nil,
          :severity => String.t() | nil,
          :shortDescription => String.t() | nil,
          :type => String.t() | nil,
          :vexAssessment => GoogleApi.OnDemandScanning.V1.Model.VexAssessment.t() | nil
        }

  field(:cvssScore)
  field(:cvssV2, as: GoogleApi.OnDemandScanning.V1.Model.CVSS)
  field(:cvssVersion)
  field(:cvssv3, as: GoogleApi.OnDemandScanning.V1.Model.CVSS)
  field(:effectiveSeverity)
  field(:extraDetails)
  field(:fixAvailable)
  field(:longDescription)
  field(:packageIssue, as: GoogleApi.OnDemandScanning.V1.Model.PackageIssue, type: :list)
  field(:relatedUrls, as: GoogleApi.OnDemandScanning.V1.Model.RelatedUrl, type: :list)
  field(:severity)
  field(:shortDescription)
  field(:type)
  field(:vexAssessment, as: GoogleApi.OnDemandScanning.V1.Model.VexAssessment)
end

defimpl Poison.Decoder, for: GoogleApi.OnDemandScanning.V1.Model.VulnerabilityOccurrence do
  def decode(value, options) do
    GoogleApi.OnDemandScanning.V1.Model.VulnerabilityOccurrence.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OnDemandScanning.V1.Model.VulnerabilityOccurrence do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
